@echo off
chcp 65001 >nul
title ChatTTS 0.2.4 Compatibility Verification

color 0B

echo.
echo ======================================================================
echo            ChatTTS 0.2.4 Compatibility Verification
echo ======================================================================
echo.
echo This will verify ChatTTS 0.2.4 compatibility including:
echo   - Version check
echo   - Import test
echo   - Engine initialization
echo   - Speech synthesis
echo   - Speaker consistency
echo   - Special characters handling
echo.
echo ======================================================================
echo.

cd /d "%~dp0"

REM Check Python
python --version >nul 2>&1
if errorlevel 1 (
    echo Error: Python not found!
    echo Please install Python 3.12 and add to PATH
    echo.
    pause
    exit /b 1
)

REM Run verification
python verify_chattts_024.py

if errorlevel 1 (
    echo.
    echo ======================================================================
    echo                   Verification FAILED
    echo ======================================================================
    echo.
    echo Possible solutions:
    echo   1. Reinstall ChatTTS: pip install ChatTTS==0.2.4 --force-reinstall
    echo   2. Check dependencies: pip install -r requirements.txt
    echo   3. Rollback to 0.2.1: pip install ChatTTS==0.2.1
    echo.
) else (
    echo.
    echo ======================================================================
    echo                   Verification PASSED
    echo ======================================================================
    echo.
    echo ChatTTS 0.2.4 is ready to use!
    echo You can now run: python main.py
    echo.
)

pause
